// 展开语法
const names = ["aaa", "bbb", "ccc"]
const name = "yz"

// 1.函数调用时
function foo(x, y, z) {
  console.log(x, y, z)
}

// foo.apply(null, names)
foo(...names)
foo(...name)

// 2.构造数组时
const newNames = [...names, ...name]
console.log(newNames);


// 3.ES2018(ES9)
const info = {name: "yz", age: 18}
const obj = {...info, address: "杭州市"}
console.log(obj);

// 展开运算符其实是浅拷贝